# 引入项目通用 cmake 设置
include(common)

if (DEFINED COMMON_THIRD_LIB)
  set(OPENCV_ROOT ${COMMON_THIRD_LIB}/opencv/dist)
endif()

# =============================================================================
macro(use_opencv ag_project_name)
  target_compile_definitions(${ag_project_name} PRIVATE USE_LIB_OPENCV)

  target_include_directories(${ag_project_name} PRIVATE ${OPENCV_ROOT}/$<CONFIG>/include)
  target_link_directories(${ag_project_name} PRIVATE ${OPENCV_ROOT}/$<CONFIG>/x64/vc17/staticlib)
  target_link_libraries(${ag_project_name} PRIVATE opencv_world460$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE ippicvmt)
  target_link_libraries(${ag_project_name} PRIVATE ittnotify$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE ippiw$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE libopenjp2$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE IlmImf$<$<CONFIG:Debug>:d>)
  
  #target_link_libraries(${ag_project_name} PRIVATE libjpeg-turbo$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE libtiff$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE libwebp$<$<CONFIG:Debug>:d>)
  target_link_libraries(${ag_project_name} PRIVATE libpng$<$<CONFIG:Debug>:d>)
endmacro(use_opencv)